package c.i.b.a;

import android.content.Context;
import c.i.b.a.a.a;

public class d implements Runnable {
    public a a;
    public Context b;

    public d(Context context, a aVar) {
        this.a = aVar;
        this.b = context;
    }

    /* JADX WARNING: Removed duplicated region for block: B:59:? A:{SYNTHETIC, RETURN} */
    /* JADX WARNING: Removed duplicated region for block: B:50:0x0133  */
    public void run() {
        /*
        r13 = this;
        r0 = "SS-";
        r1 = java.lang.System.currentTimeMillis();
        r1 = java.lang.String.valueOf(r1);
        r2 = c.i.a.a.a.a;
        r3 = "";
        if (r2 == 0) goto L_0x0012;
    L_0x0010:
        r2 = r3;
        goto L_0x0014;
    L_0x0012:
        r2 = "https://sdfp.snssdk.com";
    L_0x0014:
        r4 = 504; // 0x1f8 float:7.06E-43 double:2.49E-321;
        r5 = new java.lang.StringBuilder;	 Catch:{ all -> 0x0113 }
        r5.<init>();	 Catch:{ all -> 0x0113 }
        r5.append(r2);	 Catch:{ all -> 0x0113 }
        r2 = "/v1/getInfoPgl";
        r5.append(r2);	 Catch:{ all -> 0x0113 }
        r2 = r5.toString();	 Catch:{ all -> 0x0113 }
        r5 = com.pgl.sys.ces.b.a();	 Catch:{ all -> 0x0113 }
        r5 = r5.a;	 Catch:{ all -> 0x0113 }
        r6 = 0;
        if (r5 == 0) goto L_0x003a;
    L_0x0031:
        r5 = java.util.Calendar.getInstance();	 Catch:{ all -> 0x0113 }
        r8 = r5.getTimeInMillis();	 Catch:{ all -> 0x0113 }
        goto L_0x003b;
    L_0x003a:
        r8 = r6;
    L_0x003b:
        r5 = 301; // 0x12d float:4.22E-43 double:1.487E-321;
        r10 = r13.b;	 Catch:{ all -> 0x0113 }
        r11 = 0;
        r5 = com.pgl.sys.ces.a.meta(r5, r10, r11);	 Catch:{ all -> 0x0113 }
        r5 = (byte[]) r5;	 Catch:{ all -> 0x0113 }
        r10 = com.pgl.sys.ces.b.a();	 Catch:{ all -> 0x0113 }
        r10 = r10.a;	 Catch:{ all -> 0x0113 }
        if (r10 == 0) goto L_0x0056;
    L_0x004e:
        r6 = java.util.Calendar.getInstance();	 Catch:{ all -> 0x0113 }
        r6 = r6.getTimeInMillis();	 Catch:{ all -> 0x0113 }
    L_0x0056:
        r10 = com.pgl.sys.ces.b.a();	 Catch:{ all -> 0x0113 }
        r10 = r10.a;	 Catch:{ all -> 0x0113 }
        if (r10 == 0) goto L_0x0075;
    L_0x005e:
        r10 = "CZL_Efficient";
        r11 = new java.lang.StringBuilder;	 Catch:{ all -> 0x0113 }
        r11.<init>();	 Catch:{ all -> 0x0113 }
        r12 = "[Efficient] selas : ";
        r11.append(r12);	 Catch:{ all -> 0x0113 }
        r6 = r6 - r8;
        r11.append(r6);	 Catch:{ all -> 0x0113 }
        r6 = r11.toString();	 Catch:{ all -> 0x0113 }
        android.util.Log.d(r10, r6);	 Catch:{ all -> 0x0113 }
    L_0x0075:
        if (r5 == 0) goto L_0x010b;
    L_0x0077:
        r6 = r5.length;	 Catch:{ all -> 0x0113 }
        if (r6 <= 0) goto L_0x010b;
    L_0x007a:
        r6 = new java.lang.StringBuilder;	 Catch:{ all -> 0x0113 }
        r6.<init>();	 Catch:{ all -> 0x0113 }
        r6.append(r2);	 Catch:{ all -> 0x0113 }
        r2 = "?os=android&app_key=";
        r6.append(r2);	 Catch:{ all -> 0x0113 }
        r6.append(r3);	 Catch:{ all -> 0x0113 }
        r2 = c.i.b.a.b.b;	 Catch:{ all -> 0x0113 }
        r6.append(r2);	 Catch:{ all -> 0x0113 }
        r2 = "&did=";
        r6.append(r2);	 Catch:{ all -> 0x0113 }
        r2 = com.pgl.sys.ces.b.c();	 Catch:{ all -> 0x0113 }
        r6.append(r2);	 Catch:{ all -> 0x0113 }
        r2 = "&version=";
        r6.append(r2);	 Catch:{ all -> 0x0113 }
        r2 = "1.0.5";
        r6.append(r2);	 Catch:{ all -> 0x0113 }
        r2 = "&version_code=";
        r6.append(r2);	 Catch:{ all -> 0x0113 }
        r2 = "5";
        r6.append(r2);	 Catch:{ all -> 0x0113 }
        r2 = "&time=";
        r6.append(r2);	 Catch:{ all -> 0x0113 }
        r6.append(r1);	 Catch:{ all -> 0x0113 }
        r1 = r6.toString();	 Catch:{ all -> 0x0113 }
        r2 = 0;
    L_0x00bc:
        r3 = 3;
        if (r2 >= r3) goto L_0x00ff;
    L_0x00bf:
        r3 = c.i.b.a.c.a.a(r1, r5);	 Catch:{ all -> 0x0113 }
        r4 = new org.json.JSONObject;	 Catch:{ all -> 0x0113 }
        r4.<init>(r3);	 Catch:{ all -> 0x0113 }
        r3 = "code";
        r3 = r4.getInt(r3);	 Catch:{ all -> 0x0113 }
        r6 = 202; // 0xca float:2.83E-43 double:1.0E-321;
        r7 = 200; // 0xc8 float:2.8E-43 double:9.9E-322;
        if (r3 == r7) goto L_0x00e5;
    L_0x00d4:
        if (r3 == r6) goto L_0x00e5;
    L_0x00d6:
        r2 = r2 + 1;
        r4 = r2 * 3;
        r4 = r4 * 1000;
        r6 = (long) r4;
        java.lang.Thread.currentThread();	 Catch:{ all -> 0x00e3 }
        java.lang.Thread.sleep(r6);	 Catch:{ all -> 0x00e3 }
    L_0x00e3:
        r4 = r3;
        goto L_0x00bc;
    L_0x00e5:
        r1 = "token_id";
        if (r3 != r7) goto L_0x00ef;
    L_0x00e9:
        r2 = r4.getString(r1);	 Catch:{ all -> 0x0113 }
        c.i.b.a.b.c = r2;	 Catch:{ all -> 0x0113 }
    L_0x00ef:
        if (r3 != r6) goto L_0x00fe;
    L_0x00f1:
        r1 = r4.getString(r1);	 Catch:{ all -> 0x0113 }
        c.i.b.a.b.c = r1;	 Catch:{ all -> 0x0113 }
        r2 = 302; // 0x12e float:4.23E-43 double:1.49E-321;
        r4 = r13.b;	 Catch:{ all -> 0x0113 }
        com.pgl.sys.ces.a.meta(r2, r4, r1);	 Catch:{ all -> 0x0113 }
    L_0x00fe:
        r4 = r3;
    L_0x00ff:
        c.i.b.a.b.a = r4;	 Catch:{ all -> 0x0113 }
        r1 = com.pgl.sys.ces.b.a();
        r2 = new java.lang.StringBuilder;
        r2.<init>();
        goto L_0x0120;
    L_0x010b:
        r1 = new java.lang.NullPointerException;	 Catch:{ all -> 0x0113 }
        r2 = "NullPointerException";
        r1.<init>(r2);	 Catch:{ all -> 0x0113 }
        throw r1;	 Catch:{ all -> 0x0113 }
    L_0x0113:
        r1 = 500; // 0x1f4 float:7.0E-43 double:2.47E-321;
        c.i.b.a.b.a = r1;	 Catch:{ all -> 0x013b }
        r1 = com.pgl.sys.ces.b.a();
        r2 = new java.lang.StringBuilder;
        r2.<init>();
    L_0x0120:
        r2.append(r0);
        r0 = c.i.b.a.b.a;
        r2.append(r0);
        r0 = r2.toString();
        r1.reportNow(r0);
        r0 = r13.a;
        if (r0 == 0) goto L_0x013a;
    L_0x0133:
        r1 = c.i.b.a.b.a();
        r0.a(r1);
    L_0x013a:
        return;
    L_0x013b:
        r1 = move-exception;
        r2 = com.pgl.sys.ces.b.a();
        r0 = c.b.a.a.a.g(r0);
        r3 = c.i.b.a.b.a;
        r0.append(r3);
        r0 = r0.toString();
        r2.reportNow(r0);
        throw r1;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.i.b.a.d.run():void");
    }
}
